﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>


<h1>Edit | Изменение данных:</h1>

<form:form action="${action}" commandName="car"
	modelAttribute="car" method="POST">

	<form:label path="carBrand">CarBrand:</form:label>
	<form:input path="carBrand" />
	<form:errors path="carBrand" />
	<br />

	<form:label path="color">Color:</form:label>
	<form:input path="color" />
	<form:errors path="color" />
	<br />

	<form:label path="stateNumber">State Number:</form:label>
	<form:input path="stateNumber" />
	<form:errors path="stateNumber" />
	<br />

	<form:label path="priceOfRentPer24Hours">Price of 24h rent:</form:label>
	<form:input path="priceOfRentPer24Hours" />
	<form:errors path="priceOfRentPer24Hours" />
	<br />



	<c:if test="${car.carId > 0}">
		<form:label path="carId">ID:</form:label>
		<form:hidden path="carId" /> ${car.carId} <br />
		<br />
	</c:if>

	<c:if test="${car.carId == 0}">
		<form:label path="carId">ID:</form:label>
		<form:input path="carId" />
		<form:errors path="carId" />
		<br />
		<br />
	</c:if>

	<br />
	<br />
	
	<input type="submit" value="Save | Сохранить" />
	<input type="reset" value="Cancel | Отмена" onclick="window.history.back();"/>

</form:form>
